<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>初识vue</title>
</head>
<body>
  <!-- 

   -->
  <div id = 'root'>
    <h1>hello, {{ _data.name }}</h1>
    <button v-on:click="meth1">不传参</button>
    <button @click="meth2($event, 2)">简写传参</button>
  </div>
  <script type="text/javascript" src="../js/vue.js"></script>
<script>
  Vue.config.productionTip = false
  const vm = new Vue({
    el: '#root',
    data() {
      return {
      name: '海绵宝宝',
      address: '蚌埠'
    }
    },
    methods: {
      meth1(event) {
        console.log(event);
        alert("不传参点击")
      },
      meth2(event, num) {
        console.log(event, num);
        alert("传参点击")
      }
    },

  });

</script>
</body>
</html>